#!/bin/sh

if [ "$1" = "autoconf" ]; then
	echo 'yes'
	exit 0
fi

if [ "$1" = "config" ]; then
	cat <<EOF
graph_title Swap Utilization
graph_category memory
graph_vlabel byte
graph_args --base 1024 -l 0
graph_info Swap utilization
swap.label swap
swap.draw AREA
swapcap.label swapcap
swapcap.draw LINE1
EOF
	exit 0
fi

kstat -p memory_cap:*:*:swapcap kstat -p memory_cap:*:*:swap | sed 's/.*://g' | awk '{ print $1 ".value", $2 }'
